ScxV6Server.Systems Method
Returns an ScxV6Systems collection of all possible database connections.
Remarks
Database connections are configured in the Client Connections tools. This property provides programatic access to the connections defined in this list.
The following example written in VB.NET presents the user with a list of available systems, allowing the user to select the system to connect to.
Dim Svr As ScxV6DbClient.ScxV6Server
' Create the server object
Svr = New ScxV6DbClient.ScxV6Server
' Enumerate all the configured systems, allowing the user to
' select a system to connect to
Dim Systems As ScxV6DbClient.ScxV6Systems
Systems = Svr.Systems
Console.WriteLine("Select a system to connect to:")
Dim I As Integer
For I = 1 To Systems.Count
Console.WriteLine("{0}: {1}", I, Systems(I))
Next
Dim CKI As ConsoleKeyInfo
CKI = Console.ReadKey(True)
Dim Selection As Integer
Selection = Asc(CKI.KeyChar) - Asc("0")
If (Selection > 0 And Selection <= Systems.Count) Then
' Connect to the selected system
Try
Svr.Connect(Systems(Selection), "", "")
Catch ex As Exception
Console.WriteLine("Failed to connect to system, {0}", ex.Message)
End Try
Else
Console.WriteLine("Selection out of range")
End If